<?php
namespace app\webadmin\validate;

use think\Validate;

class DuibiduCheck extends Validate
{
    protected $rule = [
        'codes' => 'require|unique:duibidu',
        'name' => 'require',
        'id' => 'require',
       // 'shishi_date'=>'require',
        'jizhun_date'=>'require',
        'jielu_date'=>'require',
        'price'=>'require',
    ];

    protected $message = [
        'codes.require' => '股票代码名称不能为空',
        'codes.unique' => '股票代码名称已经存在',
        'name.unique' => '名称不能为空',
        //'shishi_date.unique' => '造假实施日不能为空',
        'jizhun_date.unique' => '基准实施日不能为空',
        'jielu_date.unique' => '揭露实施日不能为空',
        'price.unique' => '基准日股价不能为空',
        'id.require' => '缺少更新条件',
    ];

    protected $scene = [
        'add' => ['codes','name','jizhun_date','jielu_date','price'],
        'edit' => ['id','codes','name','jizhun_date','jielu_date','price'],
    ];
}